From 760b540c8cb0bf0201eac3b59a698972d26ec59b Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Thu, 25 Feb 2016 04:02:39 +0100 Subject: [PATCH] treeview: Don't make things way too high If the size-request is larger than the dedicated size, don't increase the dedicated size by the size request, only increase it to the size request. --- gtk/gtktreeview.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c index 47ea9f7cc6..e46737d569 100644 --- a/gtk/gtktreeview.c +++ b/gtk/gtktreeview.c @@ -2991,8 +2991,8 @@ gtk_tree_view_size_allocate (GtkWidget *widget, gtk_widget_get_preferred_width (GTK_WIDGET (child->widget), &size, NULL); if (size > child_rect.width) { - child_rect.x -= size / 2; - child_rect.width += size; + child_rect.x -= (size - child_rect.width) / 2; + child_rect.width = size; } gtk_widget_get_preferred_height_for_width (GTK_WIDGET (child->widget), @@ -3000,8 +3000,8 @@ gtk_tree_view_size_allocate (GtkWidget *widget, &size, NULL); if (size > child_rect.height) { - child_rect.y -= size / 2; - child_rect.height += size; + child_rect.y -= (size - child_rect.height) / 2; + child_rect.height = size; } /* push the rect back in the visible area if needed, preferring the top left corner */ -- 2.30.2